<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery1.9/jquery-1.9.0.js"></script>
    <style>
        .container{
            width:800px;
            height: 20px;
            border:1px solid #ccc;
            margin:50px auto;
        }
        .btns{
            width: 100px;
            height: 20px;
            margin:0 auto;
        }
    </style>
    <script>
        var i=1;
        var timer;
        function doStart(){
            $("#start")[0].disabled=true;//禁用开始按钮
            $("#stop")[0].disabled=false;//启用停止按钮
            if(i>100){
                return;
            }
            $(".progress").css("width",i+"%");
            $(".progress").css("height","20px");
            $(".progress").css("background","#ccc");
            i=i+1;
            timer=setTimeout(doStart,100);
        }
        function doStop(){
            $("#start")[0].disabled=false;//启用开始按钮
            $("#stop")[0].disabled=true;//禁用停止按钮
            clearTimeout(timer);
        }
    </script>
</head>
<body>
    <div class="container">
        <div class="progress"></div>
    </div>
    <div class="btns">
        <input type="button" value="开始" id="start" onclick="doStart()">
        <input type="button" value="停止" id="stop" onclick="doStop()">
    </div>
</body>
</html>